#ifndef __MYSTDIO_H_
#define __MYSTDIO_H_ 

#define FLUSH_NONE 1
#define FLUSH_LINE 2
#define FLUSH_FULL 4

#define SIZE 1024
#define UMASK 0666

#define FORCE 1
#define NORMAL 2


typedef struct MY_IO_FILE
{
    int fileno;//文件描述符
    int flag;//刷新方式
    char outbuffer[SIZE];//缓冲区
    int cur;//当前已经使用的空间
    int cap;//容量大小
}MYFILE;

MYFILE* myfopen(const char* name,const char* mode);
int mywrite(const char* s,int size,MYFILE* fp);
void myfclose(MYFILE* fp);
void myfflush(MYFILE* fp);

#endif 
